package cn.com.cifi.mars.mapper.mars;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import cn.com.cifi.mars.bean.dto.DmDmContractMonthDto;
import cn.com.cifi.mars.bean.dto.SupplyMonthlyVersionDto;
import cn.com.cifi.mars.entity.DmDmSupplyMonthlyDetail;
import cn.com.cifi.mars.entity.DmDmValueReport;
import cn.com.cifi.mars.entity.PriceVersion;
import cn.com.cifi.mars.entity.SupplyPlanVersion;
import cn.com.cifi.mars.entity.common.SysProjectFetchNumber;

/**
 * <p>
 * 月度供货明细表 Mapper 接口
 * </p>
 *
 * @author plx
 * @since 2020-02-24
 */
public interface DmDmSupplyMonthlyDetailMapper extends BaseMapper<DmDmSupplyMonthlyDetail> {
	
	int removeMonthData(@Param("month") String month);
	
	int removeMonthDataByProjectId(@Param("month")String yearMonth,@Param("projectId") String projectId);
	/**
	 * 
	 * @Description：批量保存数据
	 * @author：yyd
	 * @date：2020年2月25日 下午3:25:22
	 */
	void insertBatch(@Param("dataList")List<DmDmSupplyMonthlyDetail> dataList);
	
	/**
	 * 
	 * @Description：获取项目清单
	 * @author：yyd
	 * @date：2020年2月26日 上午9:25:51
	 */
	List<DmDmSupplyMonthlyDetail> selectProjectList(@Param("deadline")String deadline);
	
	List<DmDmSupplyMonthlyDetail> selectListByVersionDate(@Param("deadline")String deadline);
	
	List<SupplyPlanVersion> selectAllStage(@Param("isDel") int isDel);
	
	PriceVersion selectSaleValue(@Param("stageId")String stageId,@Param("month")String month, @Param("isDel")int isDel);
	
	PriceVersion selectNewestVersionByFidAndTypes(@Param("stageId")String stageId,@Param("types") List<String> types,@Param("month")String month, @Param("isDel")int isDel);
	
	SupplyMonthlyVersionDto selectNewestVersionByPriceId(@Param("priceVersionId") String priceVersionId, @Param("isDel")int isDel);
	
	List<SysProjectFetchNumber> selectProjectFetchNumber();

	List<SupplyPlanVersion> selectAllVersionList(@Param("versionMonth") String versionMonth, @Param("isDel")int isDel);

    List<String> selectVersionDateList();
    
	List<DmDmSupplyMonthlyDetail> selectHisDataList(@Param("deadline")String deadline,@Param("yearStr") String yearStr, @Param("monthStr")String monthStr, @Param("status")String status);
	List<DmDmSupplyMonthlyDetail> selectDataList(@Param("deadline")String deadline);
	
	List<DmDmValueReport> selectReportList(@Param("yearMonth")String yearMonth);

	List<DmDmContractMonthDto> selectContractList();

	String selectMaxVersionDate(@Param("endDate") String endDate);

	int removeMonthNewestData(@Param("newestDate")String newestDate);
	void insertSyncNewest(@Param("newestDate") String newestDate, @Param("yearStr")String yearStr, @Param("monthStr")String monthStr, @Param("status")String string);


}
